from typing import Union

import fastapi_cdn_host
from fastapi import FastAPI


app = FastAPI()

# 启动app时会自动将CDN更换为响应速度较快的那个
fastapi_cdn_host.patch_docs(app)

@app.get("/")
async def read_root():
    return {"Hello": "World"}


@app.get(
    "/items/{item_id}",
    tags=["123,这个是标题"],
    summary="123,这个是总结",
    description="123,这个是详情",
    response_description="123,这个是响应的详情",
    deprecated=True #这个是废弃请求的参数
)
def read_item(item_id: int):
    return {"item_id": item_id}

if __name__ == '__main__':
    import uvicorn 
    uvicorn.run("main:app", port=8080, reload=True)

